import axios from "@/util/http";

export default {
  state: {
    food_style_list: [],
  },
  getters: {},
  mutations: {
    setFoodStyleList(state, data) {
      state.food_style_list = data;
    },
  },
  actions: {
    get_all_food_style(context, data) {
      const url = "/food/style/get/all/";
      const postData = data.form;
      const config = {
        headers: {
          Authorization: "Bearer " + postData.token,
        },
      };
      axios
        .post(url, postData, config)
        .then((resp) => {
          if (resp.data.code == 200) {
            context.commit("setFoodStyleList", resp.data.data);
          }
        })
        .catch((resp) => {
          console.log(resp.data);
        });
    },
  },
  modules: {},
};
